<%@ page language="java" contentType="text/html; charset=UTF-8"    pageEncoding="UTF-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<%@ taglib prefix="sec"    uri="http://www.springframework.org/security/tags"%>
<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt"%>
<sec:authentication property="principal" var="currentPrincipal" scope="page" />

<fmt:setBundle basename="ApplicationMessage" />
<fmt:setLocale value="zh_CN" />

<!DOCTYPE html>
<html lang="zh-CN">
<head>

  <%@ include file="/WEB-INF/include/meta.jsp"%>
  <%@ include file="/WEB-INF/include/css.jsp"%>

</head>

<body class="ms-theme-blue">

  <%@ include file="/WEB-INF/include/header.jsp"%>
  <%@ include file="/WEB-INF/include/submenu.jsp"%>
  
  <div class="container-fluid ms-container has-ms-sidemenu">
    
    <ol class="ms-breadcrumb breadcrumb">
      <li class="active">运输收入明细表查询</li>
    </ol>
    
    <div class="ms-content-layout" style="width: 100%; overflow-x: scroll;">
      <table class="table table-hover ms-table" style="min-width: 4200px;">
        <thead>
          <tr>
            <th>序号</th>
            <th>驳运车</th>
            <th>订单号</th>
            <th>调度单号</th>
            <th>派车单号</th>
            <th>预计发车时间</th>
            <th>调度指令时间</th>
            <th>运输方式</th>
            <th>委托方</th>
            <th>承运方</th>
            <th>最终客户</th>
            <th>制造商</th>
            <th>出发地</th>
            <th>目的地</th>
            <th>回单日期</th>
            <th>可结算标识</th>
            <th>总收入</th>
            <th>费率</th>
            <th>结算公里数</th>
            <th>是否暂估</th>
            <th>是否开票</th>
            <th>开票日期</th>
            <th>是否销单</th>
            <th>车型大类</th>
            <th>颜色</th>
            <th>VIN码</th>
            <th>承接车队</th>
            <th>外结费用</th>
            <th>外结单价</th>
            <th>外结公里数</th>
            <th>外结是否暂估</th>
            <th>FMS公司代码</th>
            <th>原始收入订单</th>
            <th>VIN码</th>
            <th>调度单号</th>
            <th>运输成本</th>
            <th>运输收入</th>
            <th>SESSION_ID</th>
          </tr>
        </thead>
        
        <tbody>
          <c:forEach var="result" items="${result}" varStatus="status">
            <tr>
              <td>${status.count}</td>
              <td>${result.vehicle}</td>
              <td>${result.orderCode}</td>
              <td>${result.shipmentLoadNumber}</td>
              <td>${result.dispatchOrderCode}</td>
              <td><fmt:formatDate value="${result.leavingTime}" pattern="yyyy-MM-dd HH:mm:ss"/></td>
              <td><fmt:formatDate value="${result.shipmentDate}" pattern="yyyy-MM-dd HH:mm:ss"/></td>
              <td>${result.transType}</td>
              <td>${result.consignorName}</td>
              <td>${result.transName}</td>
              <td>${result.client}</td>
              <td>${result.manufactorName}</td>
              <td>${result.srcFacility}</td>
              <td>${result.destFacility}</td>
              <td><fmt:formatDate value="${result.accConfirmDate}" pattern="yyyy-MM-dd"/></td>
              <td>${result.collectStatus}</td>
              <td><fmt:formatNumber value="${result.parentFee}" pattern="0.00" /></td>
              <td><fmt:formatNumber value="${result.parentFeeRate}" pattern="0.00" /></td>
              <td><fmt:formatNumber value="${result.parentKilometer}" pattern="0.00" /></td>
              <td>${result.parentTemporary ? '是' : '否'}</td>
              <td>${result.sapInvoice ? '是' : '否'}</td>
              <td><fmt:formatDate value="${result.sapInvoiceDate}" pattern="yyyy-MM-dd"/></td>
              <td>${result.balanced ? '是' : '否'}</td>
              <td>${result.carName}</td>
              <td>${result.colorName}</td>
              <td>${result.vincode}</td>
              <td>${result.childTransName}</td>
              <td><fmt:formatNumber value="${result.childFee}" pattern="0.00" /></td>
              <td><fmt:formatNumber value="${result.childFeeRate}" pattern="0.00" /></td>
              <td><fmt:formatNumber value="${result.childKilometer}" pattern="0.00" /></td>
              <td>${result.childTemporary ? '是' : '否'}</td>
              <td>${result.organizationCode}</td>
              <td>${result.orderId}</td>
              <td>${result.ayvin}</td>
              <td>${result.shipmentLoadNumber}</td>
              <td><fmt:formatNumber value="${result.childFee}" pattern="0.00" /></td>
              <td><fmt:formatNumber value="${result.parentFee}" pattern="0.00" /></td>
              <td>${result.sessionId}</td>
            </tr>
          </c:forEach>
        </tbody>
        
        <tfoot>
          <tr>
            <td colspan="38" class="no-vertical-padding">
              <div class="pull-left">
                <jsp:include page="/WEB-INF/include/page.jsp">
                  <jsp:param name="url" value="${ctx.host}/reports" />
                  <jsp:param name="queryString" value="${queryString}" />
                  <jsp:param name="method" value="POST" />
                </jsp:include>
              </div>
              
              <div class="pull-right form-post-export">
                <c:if test="${page.totals > 0}">
                  <a href="javascript:void(0);" data-page="${page.currentPage}" data-per="${config.everyPage}" class="btn btn-default ms-export">输出当前记录</a>
                  <a href="javascript:void(0);" data-page="1" data-per="${config.limit}" class="btn btn-default ms-export">输出所有记录</a>
                </c:if>
              </div>
            </td>
          </tr>
        </tfoot>
      </table>
      
      <form action="${ctx.host}/reports" method="POST" class="hide form-post" id="reportForm">
        <input type="hidden" name="transport-revenue-schedule" value="true">
        <input type="hidden" name="organizationId" value="${reportSearch.organizationId}">
        <input type="hidden" name="business" value="${reportSearch.business}">
        <input type="hidden" name="srcWhId" value="${reportSearch.srcWhId}">
        <input type="hidden" name="destWhId" value="${reportSearch.destWhId}">
        <input type="hidden" name="consignorId" value="${reportSearch.consignorId}">
        <input type="hidden" name="customerId" value="${reportSearch.customerId}">
        <input type="hidden" name="vhModelId" value="${reportSearch.vhModelId}">
        <input type="hidden" name="companyId" value="${reportSearch.companyId}">
        <input type="hidden" name="collectStatus" value="${reportSearch.collectStatus}">
        <input type="hidden" name="team" value="${reportSearch.team}">
        <input type="hidden" name="invoice" value="${reportSearch.invoice}">
        <input type="hidden" name="balanced" value="${reportSearch.balanced}">
        
        <input type="hidden" name="beginShipmentDate" value='${reportSearch.beginShipmentDate}'>
        <input type="hidden" name="endShipmentDate" value='${reportSearch.endShipmentDate}'>
        <input type="hidden" name="beginAccConfirmDate" value='${reportSearch.beginAccConfirmDate}'>
        <input type="hidden" name="endAccConfirmDate" value='${reportSearch.endAccConfirmDate}'>
        <input type="hidden" name="beginInvoiceDate" value='${reportSearch.beginInvoiceDate}'>
        <input type="hidden" name="endInvoiceDate" value='${reportSearch.endInvoiceDate}'>
        
        <input type="hidden" name="loadNumbers" value="${reportSearch.loadNumbers}">
        <input type="hidden" name="orderCodes" value="${reportSearch.orderCodes}">
        
      </form>
      
      <form action="${ctx.host}/reports/transport-revenue-schedule-export" method="POST" class="hide form-export" id="reportFormExport">
        <input type="hidden" name="organizationId" value="${reportSearch.organizationId}">
        <input type="hidden" name="business" value="${reportSearch.business}">
        <input type="hidden" name="srcWhId" value="${reportSearch.srcWhId}">
        <input type="hidden" name="destWhId" value="${reportSearch.destWhId}">
        <input type="hidden" name="consignorId" value="${reportSearch.consignorId}">
        <input type="hidden" name="customerId" value="${reportSearch.customerId}">
        <input type="hidden" name="vhModelId" value="${reportSearch.vhModelId}">
        <input type="hidden" name="companyId" value="${reportSearch.companyId}">
        <input type="hidden" name="collectStatus" value="${reportSearch.collectStatus}">
        <input type="hidden" name="team" value="${reportSearch.team}">
        <input type="hidden" name="invoice" value="${reportSearch.invoice}">
        <input type="hidden" name="balanced" value="${reportSearch.balanced}">
        
        <input type="hidden" name="beginShipmentDate" value='${reportSearch.beginShipmentDate}'>
        <input type="hidden" name="endShipmentDate" value='${reportSearch.endShipmentDate}'>
        <input type="hidden" name="beginAccConfirmDate" value='${reportSearch.beginAccConfirmDate}'>
        <input type="hidden" name="endAccConfirmDate" value='${reportSearch.endAccConfirmDate}'>
        <input type="hidden" name="beginInvoiceDate" value='${reportSearch.beginInvoiceDate}'>
        <input type="hidden" name="endInvoiceDate" value='${reportSearch.endInvoiceDate}'>
        
        <input type="hidden" name="loadNumbers" value="${reportSearch.loadNumbers}">
        <input type="hidden" name="orderCodes" value="${reportSearch.orderCodes}">
        
      </form>
      
    </div>
     
  </div>       
  
  <%@ include file="/WEB-INF/include/script.jsp"%>
  
  
</body>
</html>